From: Georges Basile Stavracas Neto Date: Sat, 2 Jan 2021 20:56:57 +0000 (-0300) Subject: workspacesView/workspacesDisplay: Scroll on horizontal layouts X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~616^2^2~559 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=cffad8b749dd1705ba6278ed0422f690d0ccd7ff;p=gnome-shell.git workspacesView/workspacesDisplay: Scroll on horizontal layouts WokspacesDisplay simply remaps the scroll direction into the next workspace, but that doesn't account for the new horizontal layout. Scroll horizontally on horizontal layouts when scroll direction is on the vertical axis. Part-of: --- diff --git a/js/ui/workspacesView.js b/js/ui/workspacesView.js index 12f5ca3a8..8fc21c40d 100644 --- a/js/ui/workspacesView.js +++ b/js/ui/workspacesView.js @@ -772,14 +772,21 @@ class WorkspacesDisplay extends St.Widget { return Clutter.EVENT_PROPAGATE; let workspaceManager = global.workspace_manager; + const vertical = workspaceManager.layout_rows === -1; let activeWs = workspaceManager.get_active_workspace(); let ws; switch (event.get_scroll_direction()) { case Clutter.ScrollDirection.UP: - ws = activeWs.get_neighbor(Meta.MotionDirection.UP); + if (vertical) + ws = activeWs.get_neighbor(Meta.MotionDirection.UP); + else + ws = activeWs.get_neighbor(Meta.MotionDirection.LEFT); break; case Clutter.ScrollDirection.DOWN: - ws = activeWs.get_neighbor(Meta.MotionDirection.DOWN); + if (vertical) + ws = activeWs.get_neighbor(Meta.MotionDirection.DOWN); + else + ws = activeWs.get_neighbor(Meta.MotionDirection.RIGHT); break; case Clutter.ScrollDirection.LEFT: ws = activeWs.get_neighbor(Meta.MotionDirection.LEFT);